<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改个人扫码单')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-personOrder-edit" th:object="${zsyhPersonOrder}">
            <h4 class="form-header h4">个人扫码单信息</h4>
            <input name="id" th:field="*{id}" type="hidden">
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">用户id：</label>
                <div class="col-sm-8">
                    <input name="userId" th:field="*{userId}" class="form-control" type="text">
                </div>
            </div>-->

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">订单类型：</label>
                        <div class="col-sm-8">
                            <input name="orderTypeName" th:field="*{orderTypeName}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label" style="color: red">网点电话：</label>
                        <div class="col-sm-8">
                            <input name="rakerStorePhone" th:field="*{rakerStorePhone}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label" style="color: red">网点店铺：</label>
                        <div class="col-sm-8">
                            <input name="rakerStoreName" th:field="*{rakerStoreName}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label" style="color: red">网点联系人：</label>
                        <div class="col-sm-8">
                            <input name="rakerStorePerson" th:field="*{rakerStorePerson}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>


            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">联系人：</label>
                        <div class="col-sm-8">
                            <input name="userName" th:field="*{userName}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">联系电话：</label>
                        <div class="col-sm-8">
                            <input name="userPhone" th:field="*{userPhone}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">详细地址：</label>
                        <div class="col-sm-8">
                            <input name="userAddress" th:field="*{userAddress}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">故障类型：</label>
                        <div class="col-sm-8">
                            <!--<input name="serviceTypeId" th:field="*{serviceTypeId}" class="form-control" type="text">-->
                            <input name="serviceTypeName" th:field="*{serviceTypeName}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">故障说明：</label>
                        <div class="col-sm-8">
                            <textarea name="faultComment" class="form-control">[[*{faultComment}]]</textarea>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">订单状态：</label>
                        <div class="col-sm-8">
                            <select name="orderState" class="form-control m-b" th:with="type=${@dict.getType('order_state')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{orderState}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">维修数量：</label>
                        <div class="col-sm-8">
                            <input name="orderNumber" th:field="*{orderNumber}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">完工订单备注：</label>
                        <div class="col-sm-8">
                            <input name="completeRemark" th:field="*{completeRemark}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">服务费 ：</label>
                        <div class="col-sm-8">
                            <input name="orderServiceMoney" th:field="*{orderServiceMoney}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">上门费：</label>
                        <div class="col-sm-8">
                            <input name="orderDoorMoney" th:field="*{orderDoorMoney}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">接单师傅：</label>
                        <div class="col-sm-8">
                            <input name="repairStoreId" th:field="*{storePerson}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">抽成费用：</label>
                        <div class="col-sm-8">
                            <input name="orderFixdraw" th:field="*{orderFixdraw}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">固定抽成费用支付状态：</label>
                        <div class="col-sm-8">
                            <input name="orderFixdrawState" th:field="*{orderFixdrawState}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">

                </div>
            </div>









            <!--<div class="form-group">
                <label class="col-sm-3 control-label">下单上传图片：</label>
                <div class="col-sm-8">
                    <textarea name="orderImage" class="form-control">[[*{orderImage}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">完工图片：</label>
                <div class="col-sm-8">
                    <textarea name="completeImage" class="form-control">[[*{completeImage}]]</textarea>
                </div>
            </div>-->

           <!-- <div class="form-group">
                <label class="col-sm-3 control-label">提成点管辖区域：</label>
                <div class="col-sm-8">
                    <input name="orderQrcodeArea" th:field="*{orderQrcodeArea}" class="form-control" type="text">
                </div>
            </div>-->





            <!--<div class="form-group">
                <label class="col-sm-3 control-label">提成点id：</label>
                <div class="col-sm-8">
                    <input name="rakerId" th:field="*{rakerId}" class="form-control" type="text">
                </div>
            </div>-->
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">省份：</label>
                <div class="col-sm-8">
                    <input name="orderPrivinceName" th:field="*{orderPrivinceName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">城市：</label>
                <div class="col-sm-8">
                    <input name="orderCityName" th:field="*{orderCityName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">区县：</label>
                <div class="col-sm-8">
                    <input name="orderDistrictName" th:field="*{orderDistrictName}" class="form-control" type="text">
                </div>
            </div>-->
            <h4 class="form-header h4">扫码单服务费信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>
                    <button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "zsyh/personOrder";
        $("#form-personOrder-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-personOrder-edit').serialize());
            }
        }

        $(function() {
            var options = {
                data: [[${zsyhPersonOrder.zsyhPersonOrderMoneyList}]],
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'index',
                    align: 'center',
                    title: "序号",
                    formatter: function (value, row, index) {
                    	var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                    	return columnIndex + $.table.serialNumber(index);
                    }
                },
                {
                    field: 'createTime',
                    align: 'center',
                    title: '创建时间',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhPersonOrderMoneyList[%s].createTime' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'updateTime',
                    align: 'center',
                    title: '修改时间',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhPersonOrderMoneyList[%s].updateTime' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'typeMoneyId',
                    align: 'center',
                    title: '维修项目id',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhPersonOrderMoneyList[%s].typeMoneyId' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'typeMoneyName',
                    align: 'center',
                    title: '维修项目',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhPersonOrderMoneyList[%s].typeMoneyName' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'money',
                    align: 'center',
                    title: '维修费',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhPersonOrderMoneyList[%s].money' value='%s'>", index, value);
                        return html;
                    }
				},
                }]
            };
            $.table.init(options);
        });

        function addColumn() {
            var count = $("#" + table.options.id).bootstrapTable('getData').length;
            sub.editColumn();
        	
            $("#" + table.options.id).bootstrapTable('insertRow', {
                index: count,
                row: {
                    index: $.table.serialNumber(count),
                    createTime: "",
                    updateTime: "",
                    typeMoneyId: "",
                    typeMoneyName: "",
                    money: "",
        	    }
            });
        }
    </script>
</body>
</html>